Quick Reference
Following are the functions and commands supported by the Xtend IVR engine.
A
The activeCalls() function obtains the number of calls active in the dialed line.
Syntax:
$numInteger = ActiveCalls(<dli>)
The activePorts() function obtains the number of ports being monitored by the Xtend IVR.
Syntax:
$numInteger = ActivePorts()
The alltrim() function trims all the leading and trailing white-space characters, tabs, carriage return and line feed from the string parameter and returns trimmed string.
Syntax:
$trimmedString = alltrim(<string>)Tell me more!
The answer command causes the script to pickup the phone line after specified number of rings.
Syntax:
answer <no:of Rings>
The ascii() function returns the ASCII code of the character entered.
Syntax:
$asciiCode = ascii(<character>)
AtomicAdd() function increments the value of a variable in a particular device.
Syntax:
AtomicAdd(<deviceId>, <$variable>, <value>)
AtomicGet() function gains access to the variables across devices.
Syntax:
$valueString = AtomicGet(<deviceId>, <$variable>)
AtomicSet() function sets the value of a variable in a particular device.
Syntax:
AtomicSet(<deviceId>, <$variable>, <value>)B
The bgPlay command plays the specified .wav file in the background. If no extension is provided, .wav is assumed automatically.
Syntax:
BgPlay <wave file>
The bgVolume command adjusts the background playback volume.
Syntax:
BgVolume <percent>
The beep command produces a beep sound on the auxiliary multimedia device or on the phoneline, if connected.
Syntax:
Beep <frequency> <duration>
The BlindTransfer() function blindly transfers the call to the particular extension phone.
Syntax:
$statusBoolean = BlindTransfer(<extensionNumber>)Tell me more!
BP command automatically sets a break point inside the script.
Syntax:
BP
The BREAK or EXIT command will cause the execution of the script to break out of the current WHILE loop.
Syntax:
BreakC
The Calls() function obtains the number of calls handled by the current port.
Syntax:
$numInteger = Calls(<dli>)
The chr() function will return the character if given its ASCII code.
Syntax:
$character = chr(<number>)
The CLEAR command will immediately clear any pending ON, PLAY, RECORD and SPEAK commands and removes any pending keys from the input queue.
Syntax:
Clear
ComClose() closes the serial port communication connection.
Syntax:
ComClose()
ComOpen() establishes a connection with the serial port.
Syntax:
ComOpen("<Communication Port>", "<BaudRate> <Parity, Databits, Stopbits> <FlowControl>")
The compare() function will compare two strings.
Syntax:
$integer = compare(<String1>, <String2>)
ComRead() reads data from the serial port.
Syntax:
$buffer = ComRead(<Size>, <Timeout>)
ComReadLine() reads a single line of data from the serial port.
Syntax:
$buffer = ComReadLine(<Timeout>)
ComReadSize() finds out the size of the data in the serial port that are ready to be read.
Syntax:
$size = ComReadSize()
ComWrite() writes data to the serial port.
Syntax:
comWrite(<buffer>)
ComWriteLine() writes a line of data to the serial port.
Syntax:
ComWriteLine(<buffer>)
The concat() function will return a copy of the string after appending all given strings (<string1>, <string2>, <string3>).
Syntax:
$concatenatedString = concat(<string1>, <string2>, <string3>)
Convert() is used to convert the wave file into the specified wave format and saves it in a separate file.
Syntax:
$status = wave.Convert ("<Source Filename>","<Codec>","[Target Filename]")
CountMessage() returns the total number of messages present in the message queue of the specified device.
Syntax:
$TotalMsg = CountMessage([DeviceId])D
The Datasize() function returns the data size of the wave file.
Syntax:
$size = wave.datasize ("<Wavefile>","[Compr]")
DeleteFile() function deletes the specified file and returns boolean value true if file is deleted, false otherwise.
Syntax:
$boolean = DeleteFile(<filename>)
DeviceSpecific() executes a function unique to a specific driver.
Syntax:
DeviceSpecific(<functionName>[, parameters])
Dial() makes an outgoing call.
Syntax:
$bool = Dial(<Phone Number>)
Display command prints messages in the Display area of the Main window.
Syntax:
Display <string>E
The Encrypt() function is to encrypt the wave file using the encryption type BLOWFISH or XOR.
Syntax
$bool = wave.Encrypt ("<Wave Filename>","<Password>","<Type>","[Destination File]")
Escape() function converts the binary characters in the string to its percentage(%) hexa form.
Syntax:
$escapedString = Escape(<string>)
The Exit command will cause the execution of the script to break out of the current WHILE loop.
Syntax:
Exit
The ExtractXmlTag() function is used to retrieve the text in which the tag should be searched for and returns the text as per the specified offset value.
Syntax:
$xmltext = ExtractXmlTag ( <xmldata>, <starting tag>, <ending tag>, [offset] )F
The Find() function finds a character or substring inside a larger string and returns the zero-based index of the first character in the 'Master string'.
Syntax:
$index = Find(<Master string>, <Sub string>, [offset])
Format() function writes formatted data to a string.
Syntax:
$formattedString = Format(fcString [,arguments]..)
Fraction() function returns the fractional part of the number.
Syntax:
$Integer = Fraction(number)
The Function keyword identifies the start of a user-defined function.
Syntax:
Function FunctionName ( Param1, Param2, ... )
<statements>
Return [Expression]G
The Get() is to get specific web page.
Syntax
$Page = http.Get("<URL>")
The GetCallProgress() function obtains the current status of a Dial() or Transfer() operation.
Syntax:
$statusString = GetCallProgress()
The Get2File() is to get specific web page into a file.
Syntax
$Status = http.Get2File("<URL>","<Filename>")
The GetInfo() function retrieves information from the driver DLL.
Syntax:
$infoString = GetInfo(<attribute>)
The GetTag() function is used to retrieve the remark attached to a tag/label within the wave file.
Syntax
$bool=wave.GetTag ("<Wave Filename>","<Tag>")
GetMessage() function fetches a string from the message queue of the specified device.
Syntax:
$msgString = GetMessage(<deviceId>)
The GetStartTime() function generates the starting date and time of the IVR.
Syntax:
$dateTime = GetStartTime()
The GetTickCount() retrieves the number of milliseconds that have elapsed since the system had started.
Syntax:
$intCount = GetTickCount()
The GetTime() function fetches the local date and time.
Syntax:
$dateTime = GetTime()
The GOTO command causes the control of the script to jump to the specified label and start execution from that position.
Syntax:
Goto <label>H
This command causes the script to hang-up the line.
Syntax:
Hangup
The hashoffile() function gives the hash value of any type of file.
Syntax
$hash = md5.hashoffile("<filename>")
The hashofstring() function gives the hash value of specified string.
Syntax
$hash = $hash = md5.hashofstring ("<String>")
The hashofwavedata() function gives the hash value of of wave file.
Syntax
$hash = $hash = md5.hashofwavedata("<Wavefile>")I
The IF statement will check the <condition> and if it's true will execute the commands inside the <statements> block. If not true, the control will move to the next <condition> or block.
Syntax:
IF <condition> <statements> ELSE <statements> ENDIF
or
IF <condition1> <statements> ELSE IF <condition2> <statements> ENDIF or
IF <condition1> <statements> ELIF <condition2> <statements> ENDIF
or
IF <condition>THEN GOTO <label>
Index() function returns the zero-based index of a substring or a character inside a larger string. If sub string or character is not found, it will return -1. Index function has the same syntax as that of Find() function.
Syntax:
$index = Index(<Master string>, <Sub string>)
The init() function is used to initialize the specific port in order to send and receive data.
Syntax
udp.init("<Port>")
The input() function will accept numbers entered on the dial-pad by the user.
Syntax:
$inputKey = input(<max digits>, [wait in seconds], [enter key], [esc key], [mask])
Integer() function returns the integral part of the number.
Syntax:
$Integer = Integer(number)
IsVariable() function searches for the given variable anywhere inside the script and returns 1 if present, 0 otherwise.
Syntax:
$boolean = IsVariable("$variable")L
The left() function will return the leftmost length of the <string>.
Syntax:
$LeftString = left(<string>, <len>)
The len() function will return the length of the <string>.
Syntax:
$length = len(<string>)
The LOAD command will load all variables from the given file.
Syntax:
Load <filename>
LoadFile() function loads the specified number of lines of text from the file to a variable.
Syntax:
$boolean = LoadFile(<filename>, <$variable>, <nooflines>)
Lock() function permits one and only one script to execute inside a block of statements.
Syntax:
Lock(<name>)
The Log command will log the given text into the log file maintained in the log directory.
Syntax:
Log <string>
The Loop command will continue the looping in the While loop.
Syntax:
Loop
The Loudness() function gives the maximum frequency of the wave within the given block size.
Syntax
$val = wave.loudness ("<Wave Filename >",[Block Size],"[Freqstoignore]")
The lower() function will return a copy of the <string> converted to lowercase.
Syntax:
$lowerCaseString = lower(<string>)
The ltrim() function will return a copy of the <string> after removing all the leading spaces.
Syntax:
$leadingSpaceTrimmedString = ltrim(<string>)M
The Merge() function merges two waves and store it in the specified location.
Syntax
$stat = wave.merge ("<Wavefile1>","<Wavefile2>","<Destination Filename>")
Mid() function extracts a substring of length [len] characters from <string>.
Syntax:
$extractedString = mid(<string>, <start index>, [len])O
The ON command will cause a jump to the specified Label.
Syntax:
ON <key> GOTO <label>P
PLAY command will playback the specified .wav file on the phone line.
Syntax:
Play <wavefile1>[<wavefile2> <wavefile3> ... <wavefileN>]
PlayTimeLeft() function returns the pending play back time in milliseconds.
Syntax:
$timeInteger = PlayTimeLeft()
PutMessage() function places a string into the message queue of the specified device.
Syntax:
PutMessage(<deviceId>, <string>)R
The Random() function returns a random number less than the given number.
Syntax:
$intNum = Random(<number>)
The RECORD command will record the incoming voice.
Syntax:
Record <seconds>
The receive() function used to receive UDP data from a specific UDP port
Syntax
udp.receive("<Timeout>")
The RecordTimeLeft() function returns the remaining time for recording.
Syntax:
$timeInteger = RecordTimeLeft()Tell me more!
The Restart command restarts Xtend IVR from Script.
Syntax:
Restart
The Reject command rejects the incoming calls.
Syntax:
Reject
The Reverse() function reverses a given string.
Syntax:
$index = Reverse(<Master string>, <Sub string>)
The ReverseFind() function finds a character or substring inside a larger string starting the search from the end.
Syntax:
$index = ReverseFind(<Master string>, <Sub string>)
The right() function will return the rightmost length of the <string>.
Syntax:
$RightString = right(<string>, <len>)
Rindex() function returns the zero-based index of a substring or a character inside a larger string starting the search from the end. Rindex() has the same syntax as that of ReverseFind() function.
Syntax:
$index = Rindex(<Master string>, <Sub string>)
The rtrim() function will return a copy of the <string> after removing all the trailing whitespaces.
Syntax:
$trailingSpaceTrimmedString = rtrim(<string>)
The RUN command will execute the specified program.
Syntax:
Run <exe file>
or
! <exe file>
The RUNTIMEOUT command sets the timeout in seconds for any subsequent RUN commands.
Syntax:
Runtimeout <seconds>S
The Save command will save all variables to the given file.
Syntax:
Save <filename>
SaveFile() function replaces the content from the variable with that of the file by the specified number of lines.
Syntax:
$boolean = SaveFile(<filename>, <$variable>, <nooflines>)
The seconds() function gives the time elapsed in seconds after the process has started.
Syntax:
$timePeriod = seconds()
The send() function sends data to the UDP port of the specified IP address.
Syntax
udp.send("<IP>",<Port>,"<Data>")
The SetInfo() function sets the attribute of the driver.
Syntax:
SetInfo(<attribute>, <value>)
The SetTag() Used to add a tag/label within the wave file.
Syntax
$bool=wave.SetTag ("<Wave Filename>","<Tag>","<Remark>")
The SetVariable() function changes the scope of the variable from local to global and assigns value to all instances of the variable.
Syntax
SetVarInVar(<variable>, <value>)
The Sleep command suspends the execution of the current script for a specified interval.
Synatx
Sleep <duration>
The SleepEvent command suspends the execution of the current script for a specified interval of time or until an event occurs.
Syntax:
SleepEvent <duration>
SoftDisconnect() function destroys a softInterconnect with a specified device.
Syntax:
SoftDisconnect(<deviceId>)
SoftInterConnect() function interconnects the current device and the specified device.
Syntax:
SoftInterConnect(<deviceId>)
SoftListen() function listens to a particular channel.
Syntax:
SoftListen(<deviceId>[, Type])
SoftStream() function streams the Incoming, Outgoing or both audio of the current device to the incoming audio of the specified device.
Syntax:
SoftStream(<deviceId>[, Type])
SoftUnlisten() function unlistens from the specified device.
Syntax:
SoftUnlisten(<deviceId>)
SoftUnstream() function releases SoftStream() to the specified device.
Syntax:
SoftUnstream(<deviceId>)
The SPEAK command will speak out the given text.
Syntax:
speak [String]
The srAcceptWords() function defines the grammar for the subsequent Input() operation.
Syntax:
srAcceptWords(<word 1>, <word 2>, ..., <word N>)
The srAudio() function specifies when the audio play back has to be stopped.
Syntax:
srAudio (<type>)
The srConfidence() function determines the level of recognition for the words/grammar defined.
Syntax:
$levelInteger = srConfidence()
The srGrammar() function loads grammar for speech recognition in the script.
Syntax:
srGrammar(<fileName>)
or
srGrammar(<actualXmlText>)
The srKeepGrammar() function sets the grammar for the subsequent Input() operation in the script.
Syntax:
srKeepGrammar(<boolean>)
SubStr() function extracts a substring from a larger string and has the same syntax as that of mid() function.
Syntax:
$extractedString = substr(<string>, <start index>, [len])T
The TIMEOUT command sets the timeout in seconds for an incoming call.
Syntax:
Timeout <seconds>
The TotalCalls() function obtains the total number of calls handled by the IVR so far.
Syntax:
$numInteger = TotalCalls()
The Transfer() function transfers the call to an extension phone.
Syntax:
$statusString = Transfer(<extensionNumber>, <timeout>)
The Type() function returns the type of the wave file.
Syntax
$val = wave.type ("<Wavefile>")U
The upper() function will return a copy of the <string> converted to uppercase.
Syntax:
$upperCaseString = upper(<string>)
The UnEscape() function reverses the Escape() process.
Syntax:
$unEscapedString = UnEscape(<string>)
The UnLock() function releases the last Lock() operation.
Syntax:
UnLock()V
VoiceLog command logs the telephony audio to a specified file.
Syntax:
VoiceLog <waveFile>
Volume command will adjust the playback volume of the specified .wav file.
Syntax:
Volume <percent>W
The WAIT command will wait for the specified number of milliseconds.
Syntax:
Wait <milliseconds>
The WHILE command will check the <condition> and if it's true will execute the commands inside the <statements> block until the condition becomes false.
Syntax:
while <condition>
<statements>
endwhile